<?php

include_once '../@base/portal.php';
include_once '../login/login.php';

$value = $post->value;
$model = $post->model;
$time = $post->time;
$user = $post->user;
$username = $user->name;
output(doSave($value, $model, $time, $username));

function doSave($value, $model, $time, $username)
{
    $sql = "INSERT INTO oprec_state VALUES(null, '{$model}', '{$value}', '{$username}', '{$time}')";
    // logfile('STATE_SAVE', $sql);
    $result = exec_sql($sql);
    // logfile('STATE_SAVE', json_encode($result, JSON_UNESCAPED_UNICODE));
}
